-
-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added database feature. #935
base: master
Are you sure you want to change the base?
Conversation
The database ist stored persistently on LittleFS. The AC total energy is written every hour to the database, together with a timestamp. Each entry to the database requires 8 bytes on the LittleFS partition. The database can be read with the API call /api/database Ralf Bauer
This code is working and has to be integrated into the UI.
Added database feature.
Looking excellent. Really hoping for this to get merged.🙏 Btw, your inverter's serial bumper is visible in the screenshot. You might want to edit that out. |
I have one last problem with the code. |
Thank you for the notification about the serial number. |
Just a few first remarks:
|
Thank you for your comments, let me clarify a few points.
|
So it will not work offline or in AP mode. And you are transfering data to google in US (which will require a DSGVO hint and a Opt-Out)..... As I said... please no libraries from external servers....
But you cannot extend a 150kb by 10bytes if you have only 50kb left... As I said, LittleFS is a copy-on-write filesystem. That means at each file operation, it creates a copy of the file, makes the changes and adjusts the file pointer in the last step to be 100% sure that there is no corrupted file system. |
|
Thats enough to require a DSVGO hint because the IP address of the fetch operation is transmitted to google. |
Hi guys, |
@t2on, I have also thought about stoing the data on an SD-card, but I decided to stay with my current solution and store all high resolution data in my InfluxDB, which is much easier and faster to query. This is pretty easy to do by using MQTT and Telegraf. |
One year OpenDTU-Database
@RaBa64 thanks for your PR / fork of OpenDTU! I still could not get it to run / flash on my OpenDTU Fusion board for some unknown reason. I come from a background / long time usage of the Round Robin DB (RRDtool) from Tobi Oetiker which is also available for ESP32 https://github.com/lbernstone/rrdtool_ESP32. Have you considered storing your data in some RRD databases, i.e. you would need
That is a total of 9888 / <10kB which you need to store every time you update it, i.e. 24 x 365 = 8760 times or <10k times a year. If you reduce that to only one daily writing it would require only ~365 writes a year, which would wear out after ~273 years 😄 |
The database ist stored persistently on LittleFS.
The AC total energy is written every hour to the database, together with a timestamp. Each entry to the database requires 8 bytes on the LittleFS partition. The database can be read with the API call /api/database
ToDo:
UI component is still missing.
Modification for chunked response needed.
Ralf Bauer
P.S.: Thanks for the great job on OpenDTU !